/* Copyright 2008 Bas van den Berg
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef AREA_H
#define AREA_H

#include <string>
#include <map>

namespace Chronos {

class Room;
class MudPlayer;
class ElevatorController;
class StringBuilder;

class Area {
public:
    Area(int id_, const std::string& name_);
    ~Area();

    void addRoom(unsigned int id, Room& room);
    Room& getRoom(int roomID) const;

	void addPlayer(MudPlayer& player, int roomID, const std::string& arriveMsg) const;
	void movePlayer(MudPlayer& player, int newRoomID, const std::string& leaveMsg, const std::string& arriveMsg);

	friend class AreaBuilder;

	const std::string& getName() const;
    void printRooms(StringBuilder& buffer) const;
private:
	int id;
	std::string name;

    typedef std::map<int, Room*> Rooms;
    typedef Rooms::const_iterator RoomsConstIter;
    Rooms rooms;

	ElevatorController* controller;		//TEMP for cleanup

    Area(const Area&);
    Area& operator=(const Area&);
};

}

#endif

